package org.mrjbee.share.it.easy.server;

import org.restlet.resource.Get;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

public class ClipboardDataResource extends ServerResource {
	
	static private ClipboardData clipboardData = new ClipboardData("Nothing yet.");
	
	@Get("text")
	public synchronized String getData(){
		if (clipboardData == null){
		 return null;
		} else {
			return clipboardData.getActualData();
		}
	}
	
	@Post("text")
	public synchronized void storeData(String text){
		clipboardData = new ClipboardData(text);
	}

}
